package edu.chen.entity;

import org.apache.ibatis.type.Alias;
import org.springframework.beans.factory.annotation.Required;

@Alias("user_")
public class User {
    private String username;
    private String password;
    private int user_age;            //年龄
    private int user_sex;           //性别 1代表男 2代表女
    private Student student;

    User(){}

    public User(String username, String password) {
        this.username = username;
        this.password = password;
    }

    public User(String username, String password,Student student) {
        this.username = username;
        this.password = password;
        this.student = student;
    }

    public String getUsername() {
        return username;
    }

    @Required   //表示在创建对象时该属性必须有
    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
    }

    public int getUser_age() {
        return user_age;
    }

    public void setUser_age(int user_age) {
        this.user_age = user_age;
    }

    public int getUser_sex() {
        return user_sex;
    }

    public void setUser_sex(int user_sex) {
        this.user_sex = user_sex;
    }

    @Override
    public String toString() {
        return "User{" +
                "username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", user_age=" + user_age +
                ", user_sex=" + user_sex +
                ", student=" + student +
                '}';
    }
}
